package Entities;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Ingrediente")
public class Entity_Ingrediente implements Serializable{

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue
	@Column(name = "id_ingrediente")
	private int idIngrediente;

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "id_insumo")
	private Entity_Insumo insumo;
	@Column
	private float cantidad;
	@Column
	private String medida;

	//GET & SET
	public Entity_Insumo getInsumo() {
		return insumo;
	}
	public void setInsumo(Entity_Insumo insumo) {
		this.insumo = insumo;
	}
	public int getIdIngrediente() {
		return idIngrediente;
	}
	public void setIdIngrediente(int idIngrediente) {
		this.idIngrediente = idIngrediente;
	}
	public float getCantidad() {
		return cantidad;
	}
	public void setCantidad(float cantidad) {
		this.cantidad = cantidad;
	}
	public String getMedida() {
		return medida;
	}
	public void setMedida(String medida) {
		this.medida = medida;
	}

}
